<template>
	<div class="info">
		<div class="title">
			<sapn
				style="position: absolute;left: 35%; border: 0cm;font-weight: bold; font-size: 60px; font-family: 'Courier New', Courier, monospace;">
				陕西理工大学投票系统</sapn>
		</div>
		<!-- 显示投票选项 -->
		<el-container>
			<el-aside width="200px" style=" background-color: rgb(238, 241, 246)">
				<el-menu :default-openeds="['1', '3']" router>
					<el-submenu index="1">
						<template slot="title"><i class="el-icon-message"></i>操作菜单</template>
						<el-menu-item-group>
							<el-menu-item index="/info/yearPeople" @click="change()">年度人物</el-menu-item>
							<el-menu-item index="/">others</el-menu-item>
						</el-menu-item-group>
					</el-submenu>
				</el-menu>
			</el-aside>
			<el-container>
				<el-header style=" background-color: #42b983; padding: 5px; text-align: right; font-size: 12px;height: 75px">
          <div style="float: left;">
            <el-avatar  src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" size="big"></el-avatar>
          </div>
					<span style="font-size: 40px; font-family: '华文彩云';">{{account}}</span>
          <br>
          <el-button type="danger" size = "mini"  plain @click="logout()">退出登录</el-button>
				</el-header>

				<el-main>
          <el-card>
					<router-view></router-view>
          </el-card>
				</el-main>
			</el-container>
		</el-container>
    <div class="bj1" v-show="disable"></div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				disable: true,
				account: '',
			}
		},
		mounted() {

			this.account = sessionStorage.getItem("name");
		},
		methods: {
      logout() {
        sessionStorage.removeItem("Roleuser");
        sessionStorage.removeItem("token");
        sessionStorage.removeItem("name");
        sessionStorage.removeItem("account");
        this.$router.push('/login');
      },
			change() {
        this.$notify.error({

          title: '提示',
          message: '每个人只可以投一次投票，请不要重复投票哦o(╥﹏╥)o！',
          duration: 0
        });
			}
		}
	}
	
</script>

<style>

  .bj1{
    position: absolute;
    left: 14%;
    top: 12%;
    width: 85%;
    height: 100%;
    background: #42b983;
    z-index: -1;
    background-image: url(https://static-data.gaokao.cn/upload/school/201906/1559825211_1139_thumb.jpg);
    background-size: cover;

  }
	.tac {
		width: 24%;
	}


</style>